﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PTTK_HTTT_06.BUS;
using System.Data.SqlClient;

namespace PTTK_HTTT_06.DAO
{
    class THUC_DON_DB
    {
        public static int ThemThucDon(THUC_DON td)
        {
            DataProvider dataProvider = new DataProvider();

            List<SqlParameter> parameterList = new List<SqlParameter>();
            parameterList.Add(new SqlParameter("MaNhanVien", td.MaNhanVien));
            parameterList.Add(new SqlParameter("NgayBatDau", td.NgayBatDau.Date));
            parameterList.Add(new SqlParameter("NgayKetThuc", td.NgayKetThuc.Date));


            int num = -1;
            if (!dataProvider.IsConnect())
                dataProvider.Connect();
            num = dataProvider.ExcuteProcedureWithReturn("ThemThucDon", parameterList.ToArray());
            dataProvider.Disconnect();

            return num;
        }
    }
}
